<template>
  <div>
    <!-- 顶部 -->
    <nav>
      <navbarTop></navbarTop>
    </nav>
    <!-- 头部 -->
    <header>
      <Header></Header>
    </header>
    <!-- 吸顶组件 -->
    <headerSticky></headerSticky>
    <!--  内容 -->
    <div class="main">
      <router-view></router-view>
    </div>
    <!-- 底部 -->
    <footer>
      <Footer></Footer>
    </footer>
  </div>
</template>

<script>
// import Home from '@/views/home';
import navbarTop from '../components/navbar-top.vue'
import Header from '../components/header.vue'
import Footer from '../components/footer.vue'
import headerSticky from '../components/header-sticky.vue'
import { useStore } from 'vuex'
export default {
  name: 'Layout',
  // 获取分类数据
  setup () {
    const store = useStore()
    store.dispatch('category/getList')
  },
  components: {
    navbarTop,
    Header,
    Footer,
    headerSticky
  }
}
</script>

<style lang="less" scoped>
.main{
  // height: 400px;
}
</style>
